#include <iostream>

int n;

int main()
{
	std::cin >> n;
	if (n & 1)
		std::cout << "0\n";
	else {
		int count = n / 4;
		if (!(n % 4)) count--;
		std::cout << count << '\n';
	}
}

